<template>
  <div id="FeqForm">
    <van-field
        v-model="exTitle"
        rows="8"
        show-word-limit
        maxlength="200"
        type="textarea"
        placeholder="请填写观点"/>
    <footer class="l-footer">
      <button class="l-footer__btn" @click="onSubmit">发布观点</button>
    </footer>
  </div>
</template>
<script lang="ts">
import Vue, {ComponentOptions, VueConstructor} from "vue"
import Component from 'vue-class-component'
import {requestByPost} from "@/utils/request";
import {Prop} from "vue-property-decorator";
import {mapState} from "vuex";

export const meta = {authValid: true};
@Component
export default class FeqForm extends Vue implements ComponentOptions<Vue> {
  name = "FeqForm"
  exTitle = ""
  @Prop() mistakeId!: any;

  async onSubmit() {
    await requestByPost(`/qqc/qqcExplain/add`, {
      exTitle: this.exTitle,
      mistakeid: this.mistakeId,
    });
    this.$toast.success("操作成功！");
    return this.$popRoute();
  }
}
</script>

<style scoped lang="scss">
@import "~assets/common.scss";

#FeqForm {
  .l-footer {
    @include absoluteFull(fixed);
    @include flex-center;
    padding: 8px 0;
    top: auto;
    box-shadow: 0 -2px 6px 0 rgba(0, 0, 0, .1);

    &__btn {
      text-align: center;
      color: #fff;
      background: #349e7e;
      width: 90%;
      height: 44px;
      border-radius: 4px;
    }
  }
}
</style>
